package com.sixth.docker.service.impl;

import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sixth.core.entity.CheckItem;
import com.sixth.core.entity.Medicines;
import com.sixth.core.vo.R;
import com.sixth.docker.mapper.CheckItemMapper;
import com.sixth.docker.service.CheckItemService;
import com.sixth.docker.vo.CheckItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: sixth-hospital-parent
 * @description:
 * @author: 赵庆龙
 * @create: 2024-08-20 09:37
 **/
@Service
public class CheckItemServiceImpl implements CheckItemService {
    @Autowired
    private CheckItemMapper checkItemMapper;
    public R<IPage<CheckItem>> selectPage(CheckItemVo checkItemVo) {
        IPage<CheckItem> page = new Page<>(checkItemVo.getPageNum(), checkItemVo.getPageSize());
        QueryWrapper<CheckItem> wrapper = new QueryWrapper<>();
        // 根据keywords进行动态查询
        if (checkItemVo.getKeywords()!= null && !checkItemVo.getKeywords().trim().isEmpty()){
            wrapper.like("keywords", checkItemVo.getKeywords().trim());
        }
        wrapper.eq("status", "0");
        IPage<CheckItem> checkItemIPage = checkItemMapper.selectPage(page, wrapper);
        return R.ok(checkItemIPage);
    }

}
